<template>
	<el-drawer title="费用申请详情" v-model="visible" :size="800" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-form>
					<el-form-item label="申请标题" prop="title">{{form.title}}
					</el-form-item>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="申请额度" prop="totalCost">{{form.cTotalCost}}/万元
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="支付时间" prop="payTime">{{form.payTime}}
							</el-form-item>

						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="关联项目" prop="projectId">{{form.pTitle}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="费用科目" prop="budgetAccountName">{{form.budgetAccountName}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="申请人" prop="applyUser">{{form.applyUserName}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="审批人" prop="approvalUser">{{form.approvalUserName}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-form-item label="费用事由">
						<div v-html="form.remark"></div>
					</el-form-item>
					<el-form-item label="相关附件" prop="attachId">
						<attach-menu :attachIds="form.attachId" :roleFlag="3" :preview="true" ></attach-menu>
					</el-form-item>
				</el-form>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
import AttachMenu from '@/views/module/attachMenu'
export default {
	emits: ['success', 'closed'],
	components: {
		AttachMenu,
	},
	data() {
		return {
			loading: false,
			form: {
				recordId:'',
				title: '',
				totalCost: '1',
				pTitle:'',
				payTime:'',
				applyUser:'',
				approvalUser:'',
				budgetAccountName:'',
				remark:'',
				attachId:''
			},
			visible: false,
			isSaveing: false,
		}
	},
	mounted() {

	},
	methods: {
		//显示
		open(model){
			this.model=model;
			this.visible = true;
			return this;
		},
		//表单注入数据
		setData(data){
			this.form.recordId=data.recordId
			this.form.title=data.title
			this.form.cTotalCost=data.cTotalCost
			this.form.pTitle=data.pTitle
			this.form.payTime=data.payTime
			this.form.applyUserName=data.applyUserName
			this.form.approvalUserName=data.approvalUserName
			this.form.budgetAccountName = data.budgetAccountName
			this.form.remark=data.remark
			this.form.attachId=data.attachId
		},
	}
}
</script>

<style>
</style>
